unit StarXMLDocumentInterface;

interface

uses Classes;

type
  IStarXMLDocument = Interface
    ['{196A6E72-E5FC-4240-8F90-B20090290F5F}']
    function OpenKey(const Key: Widestring; CanCreate: Boolean = False): Boolean;
    function DeleteKey(const Key: Widestring): Boolean;
    function KeyExists(const Key: Widestring): Boolean;
    procedure GetKeyNames(Strings: TStrings);
    procedure GetValueNames(Strings: TStrings);
    function DeleteValue(const Name: Widestring): Boolean;
    function ValueExists(const ValueName: Widestring): Boolean;

    function ReadBool(const aName: Widestring; out Value: Boolean): Boolean;
    function ReadDateTime(const aName: Widestring; out Value: TDateTime): Boolean;
    function ReadFloat(const aName: Widestring; out Value: Double): Boolean;
    function ReadInteger(const aName: Widestring; out Value: Integer): Boolean;
    function ReadString(const aName: Widestring; out Value: Widestring): Boolean;

    function ReadBoolDef(const aName: Widestring; Default: Boolean): Boolean;
    function ReadDateTimeDef(const aName: Widestring; Default: TDateTime): TDateTime;
    function ReadFloatDef(const aName: Widestring; Default: Double): Double;
    function ReadIntegerDef(const aName: Widestring; Default: Integer): Integer;
    function ReadStringDef(const aName: Widestring; Default: Widestring): Widestring;

    procedure WriteBool(const aName: Widestring; Value: Boolean);
    procedure WriteDateTime(const aName: Widestring; Value: TDateTime);
    procedure WriteFloat(const aName: Widestring; Value: Double);
    procedure WriteInteger(const aName: Widestring; Value: Integer);
    procedure WriteString(const aName, Value: Widestring);

    function LoadFromFile(const AFileName:string; CanCreate:Boolean=False):boolean;
    function LoadFromStream(const stream:TStream):boolean;
    function LoadFromXML(const XML:string):boolean;

    function SaveToFile(const FileName:string=''):boolean;
    function SaveToStream(Stream:TStream):boolean;
    function SaveToXML(var XML:String):boolean;
  end;

implementation

end.
